using System;
using System.ComponentModel;

namespace VSSDKAssist.Recipes.Common.Editors.Grid
{
    /// <summary/>
    public class TypeConverterConverter : TypeListConverter
    {
        /// <summary>
        /// Implements the filtering of types.
        /// </summary>
        /// <param name="candidate"></param>
        /// <returns>
        /// 	<see langword="true"/> if the type should be included in the list; <see langword="false"/> otherwise.
        /// </returns>
        protected override bool ShouldInclude(Type candidate)
        {
            return !candidate.IsAbstract &&
                !candidate.IsInterface &&
                typeof(TypeConverter).IsAssignableFrom(candidate);
        }
    }
}
